<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow: util/detail/util.hpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow project: Full implementation reference.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_23ec12649285f9fabf3a6b7380226c28.html">util</a></li><li class="navelem"><a class="el" href="dir_076e4717ccf31a1bda117b982e8d440f.html">detail</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#namespaces">Namespaces</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">util.hpp File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="detail_2util__fwd_8hpp_source.html">flow/util/detail/util_fwd.hpp</a>&quot;</code><br />
</div>
<p><a href="util_2detail_2util_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="namespaces" name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespaceflow"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceflow.html">flow</a></td></tr>
<tr class="memdesc:namespaceflow"><td class="mdescLeft">&#160;</td><td class="mdescRight">Catch-all namespace for the Flow project: A collection of various production-quality modules written in modern C++17, originally by ygoldfel. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:namespaceflow_1_1util"><td class="memItemLeft" align="right" valign="top">namespace &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceflow_1_1util.html">flow::util</a></td></tr>
<tr class="memdesc:namespaceflow_1_1util"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flow module containing miscellaneous general-use facilities that don't fit into any other Flow module. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aa0a4409a31022ddcb1a30936f59bbc69"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69">FLOW_UTIL_WHERE_AM_I_FROM_ARGS</a>(ARG_file,  ARG_function,  ARG_line)&#160;&#160;&#160;  ARG_file &lt;&lt; ':' &lt;&lt; ARG_function &lt;&lt; '(' &lt;&lt; ARG_line &lt;&lt; ')'</td></tr>
<tr class="memdesc:aa0a4409a31022ddcb1a30936f59bbc69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper macro, same as <a class="el" href="util__fwd_8hpp.html#a4b8c54b789ea3bbc1dedebbff084625c" title="Expands to an ostream fragment X (suitable for, for example: std::cout &lt;&lt; X &lt;&lt; &quot;: Hi!...">FLOW_UTIL_WHERE_AM_I()</a>, but takes the source location details as arguments instead of grabbing them from <code>__FILE__</code>, <code>__FUNCTION__</code>, <code>__LINE__</code>.  <a href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69">More...</a><br /></td></tr>
<tr class="separator:aa0a4409a31022ddcb1a30936f59bbc69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7758288c4d20bf772f4f99b452972134"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="util_2detail_2util_8hpp.html#a7758288c4d20bf772f4f99b452972134">FLOW_UTIL_WHERE_AM_I_FROM_ARGS_TO_ARGS</a>(ARG_file,  ARG_function,  ARG_line)&#160;&#160;&#160;  ::flow::util::get_last_path_segment(ARG_file), ':', ARG_function, '(', ARG_line, ')'</td></tr>
<tr class="memdesc:a7758288c4d20bf772f4f99b452972134"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper macro, same as <a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69" title="Helper macro, same as FLOW_UTIL_WHERE_AM_I(), but takes the source location details as arguments inst...">FLOW_UTIL_WHERE_AM_I_FROM_ARGS()</a>, but results in a list of comma-separated, instead of <code>&lt;&lt;</code> separated, arguments, although they are still to be passed to an <code>ostream</code> with exactly the same semantics as the aforementioned macro.  <a href="util_2detail_2util_8hpp.html#a7758288c4d20bf772f4f99b452972134">More...</a><br /></td></tr>
<tr class="separator:a7758288c4d20bf772f4f99b452972134"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03c693936e039ffd16a3511050496a66"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66">FLOW_UTIL_WHERE_AM_I_LITERAL</a>(ARG_function)&#160;&#160;&#160;  <a class="el" href="util_2detail_2util_8hpp.html#a69c5777221db3730b1e235424c198506">FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_OUTER</a>(ARG_function, __LINE__)</td></tr>
<tr class="memdesc:a03c693936e039ffd16a3511050496a66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper macro: like <a class="el" href="util__fwd_8hpp.html#a4b8c54b789ea3bbc1dedebbff084625c" title="Expands to an ostream fragment X (suitable for, for example: std::cout &lt;&lt; X &lt;&lt; &quot;: Hi!...">FLOW_UTIL_WHERE_AM_I()</a>, with a major relative strength &ndash; its replacement is a string literal &ndash; and two differences: the function name must be supplied verbatim as an arg; and the source file name will contain the entire path as opposed to a massaged version with just the file-name component.  <a href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66">More...</a><br /></td></tr>
<tr class="separator:a03c693936e039ffd16a3511050496a66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69c5777221db3730b1e235424c198506"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="util_2detail_2util_8hpp.html#a69c5777221db3730b1e235424c198506">FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_OUTER</a>(ARG_function,  ARG_line)&#160;&#160;&#160;  <a class="el" href="util_2detail_2util_8hpp.html#a4ac08f92e1ffa27b2743e635f54aeddd">FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_INNER</a>(ARG_function, ARG_line)</td></tr>
<tr class="memdesc:a69c5777221db3730b1e235424c198506"><td class="mdescLeft">&#160;</td><td class="mdescRight">Impl helper macro from <a class="el" href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66" title="Helper macro: like FLOW_UTIL_WHERE_AM_I(), with a major relative strength – its replacement is a stri...">FLOW_UTIL_WHERE_AM_I_LITERAL()</a>.  <a href="util_2detail_2util_8hpp.html#a69c5777221db3730b1e235424c198506">More...</a><br /></td></tr>
<tr class="separator:a69c5777221db3730b1e235424c198506"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ac08f92e1ffa27b2743e635f54aeddd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="util_2detail_2util_8hpp.html#a4ac08f92e1ffa27b2743e635f54aeddd">FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_INNER</a>(ARG_function,  ARG_line)&#160;&#160;&#160;  __FILE__ &quot;: &quot; #ARG_function &quot;(&quot; #ARG_line &quot;)&quot;</td></tr>
<tr class="memdesc:a4ac08f92e1ffa27b2743e635f54aeddd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Impl helper macro from <a class="el" href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66" title="Helper macro: like FLOW_UTIL_WHERE_AM_I(), with a major relative strength – its replacement is a stri...">FLOW_UTIL_WHERE_AM_I_LITERAL()</a>.  <a href="util_2detail_2util_8hpp.html#a4ac08f92e1ffa27b2743e635f54aeddd">More...</a><br /></td></tr>
<tr class="separator:a4ac08f92e1ffa27b2743e635f54aeddd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa60d3ba517b5f5cf408faa92d269256a"><td class="memTemplParams" colspan="2">template&lt;typename Rep , typename Period &gt; </td></tr>
<tr class="memitem:aa60d3ba517b5f5cf408faa92d269256a"><td class="memTemplItemLeft" align="right" valign="top">Fine_duration&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceflow_1_1util.html#aa60d3ba517b5f5cf408faa92d269256a">flow::util::chrono_duration_to_fine_duration</a> (const boost::chrono::duration&lt; Rep, Period &gt; &amp;dur)</td></tr>
<tr class="memdesc:aa60d3ba517b5f5cf408faa92d269256a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper that takes a non-negative duration of arbitrary precision/period and converts it to <a class="el" href="namespaceflow.html#a48799f1263cdeedec125be51a3db2b79" title="A high-res time duration as computed from two Fine_time_pts.">Fine_duration</a>, rounding up.  <a href="namespaceflow_1_1util.html#aa60d3ba517b5f5cf408faa92d269256a">More...</a><br /></td></tr>
<tr class="separator:aa60d3ba517b5f5cf408faa92d269256a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5488415feb5570a6551892a7bdfeeec4"><td class="memTemplParams" colspan="2">template&lt;typename Rep , typename Period &gt; </td></tr>
<tr class="memitem:a5488415feb5570a6551892a7bdfeeec4"><td class="memTemplItemLeft" align="right" valign="top">Fine_time_pt&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespaceflow_1_1util.html#a5488415feb5570a6551892a7bdfeeec4">flow::util::chrono_duration_from_now_to_fine_time_pt</a> (const boost::chrono::duration&lt; Rep, Period &gt; &amp;dur)</td></tr>
<tr class="memdesc:a5488415feb5570a6551892a7bdfeeec4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper that takes a non-negative duration of arbitrary precision/period and converts it to <a class="el" href="namespaceflow.html#a48799f1263cdeedec125be51a3db2b79" title="A high-res time duration as computed from two Fine_time_pts.">Fine_duration</a>, rounding up; then adds it to <code>Fine_clock::now()</code> and returns the result.  <a href="namespaceflow_1_1util.html#a5488415feb5570a6551892a7bdfeeec4">More...</a><br /></td></tr>
<tr class="separator:a5488415feb5570a6551892a7bdfeeec4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13c3363efdf0d04b04b12ca7487d368c"><td class="memItemLeft" align="right" valign="top">constexpr String_view&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceflow_1_1util.html#a13c3363efdf0d04b04b12ca7487d368c">flow::util::get_last_path_segment</a> (String_view path)</td></tr>
<tr class="memdesc:a13c3363efdf0d04b04b12ca7487d368c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper for <a class="el" href="util__fwd_8hpp.html#a4b8c54b789ea3bbc1dedebbff084625c" title="Expands to an ostream fragment X (suitable for, for example: std::cout &lt;&lt; X &lt;&lt; &quot;: Hi!...">FLOW_UTIL_WHERE_AM_I()</a> that, given a pointer/length of a string in memory containing a path, returns a pointer/length into that same buffer that comprises the postfix just past the last directory separator or (if none exists) to all of it.  <a href="namespaceflow_1_1util.html#a13c3363efdf0d04b04b12ca7487d368c">More...</a><br /></td></tr>
<tr class="separator:a13c3363efdf0d04b04b12ca7487d368c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="aa0a4409a31022ddcb1a30936f59bbc69" name="aa0a4409a31022ddcb1a30936f59bbc69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0a4409a31022ddcb1a30936f59bbc69">&#9670;&nbsp;</a></span>FLOW_UTIL_WHERE_AM_I_FROM_ARGS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FLOW_UTIL_WHERE_AM_I_FROM_ARGS</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_file, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_function, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_line&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;  ARG_file &lt;&lt; ':' &lt;&lt; ARG_function &lt;&lt; '(' &lt;&lt; ARG_line &lt;&lt; ')'</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Helper macro, same as <a class="el" href="util__fwd_8hpp.html#a4b8c54b789ea3bbc1dedebbff084625c" title="Expands to an ostream fragment X (suitable for, for example: std::cout &lt;&lt; X &lt;&lt; &quot;: Hi!...">FLOW_UTIL_WHERE_AM_I()</a>, but takes the source location details as arguments instead of grabbing them from <code>__FILE__</code>, <code>__FUNCTION__</code>, <code>__LINE__</code>. </p>
<p >Arguably not useful outside of the <code><a class="el" href="namespaceflow_1_1util.html" title="Flow module containing miscellaneous general-use facilities that don&#39;t fit into any other Flow module...">flow::util</a></code> module itself.</p>
<h3>Perf instructions</h3>
<p >For best perf results: for all <code>ARG_...</code> that you pass in as <a class="el" href="namespaceflow_1_1util.html#ae4dc52186797094b3040379ff19124c9" title="Commonly used char-based Basic_string_view. See its doc header.">flow::util::String_view</a> please follow instructions in doc header of log::Msg_metadata::m_msg_src_file and log::Msg_metadata::m_msg_src_function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ARG_file</td><td>Full file name, as from <code>__FILE__</code>, as a <code>String_view</code>; or a fragment inside it (e.g., just the part past the last dir separator if any); depending on which part you'd prefer ultimately printed. </td></tr>
    <tr><td class="paramname">ARG_function</td><td>Full function name, as from <code>__FUNCTION__</code>, as a <code>String_view</code> (recommended for perf) or <code>const char*</code>. </td></tr>
    <tr><td class="paramname">ARG_line</td><td>Line number, as from <code>__LINE__</code>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>ostream</code> fragment <code>X</code> (suitable for, for example: <code>std::cout &lt;&lt; X &lt;&lt; ": Hi!"</code>). </dd></dl>

<p class="definition">Definition at line <a class="el" href="util_2detail_2util_8hpp_source.html#l00112">112</a> of file <a class="el" href="util_2detail_2util_8hpp_source.html">util.hpp</a>.</p>

</div>
</div>
<a id="a7758288c4d20bf772f4f99b452972134" name="a7758288c4d20bf772f4f99b452972134"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7758288c4d20bf772f4f99b452972134">&#9670;&nbsp;</a></span>FLOW_UTIL_WHERE_AM_I_FROM_ARGS_TO_ARGS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FLOW_UTIL_WHERE_AM_I_FROM_ARGS_TO_ARGS</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_file, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_function, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_line&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;  ::flow::util::get_last_path_segment(ARG_file), ':', ARG_function, '(', ARG_line, ')'</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Helper macro, same as <a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69" title="Helper macro, same as FLOW_UTIL_WHERE_AM_I(), but takes the source location details as arguments inst...">FLOW_UTIL_WHERE_AM_I_FROM_ARGS()</a>, but results in a list of comma-separated, instead of <code>&lt;&lt;</code> separated, arguments, although they are still to be passed to an <code>ostream</code> with exactly the same semantics as the aforementioned macro. </p>
<h3>Perf instructions</h3>
<p >See doc header for <a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69" title="Helper macro, same as FLOW_UTIL_WHERE_AM_I(), but takes the source location details as arguments inst...">FLOW_UTIL_WHERE_AM_I_FROM_ARGS()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ARG_file</td><td>See <a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69" title="Helper macro, same as FLOW_UTIL_WHERE_AM_I(), but takes the source location details as arguments inst...">FLOW_UTIL_WHERE_AM_I_FROM_ARGS()</a>. </td></tr>
    <tr><td class="paramname">ARG_function</td><td>See <a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69" title="Helper macro, same as FLOW_UTIL_WHERE_AM_I(), but takes the source location details as arguments inst...">FLOW_UTIL_WHERE_AM_I_FROM_ARGS()</a>. </td></tr>
    <tr><td class="paramname">ARG_line</td><td>See <a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69" title="Helper macro, same as FLOW_UTIL_WHERE_AM_I(), but takes the source location details as arguments inst...">FLOW_UTIL_WHERE_AM_I_FROM_ARGS()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Exactly the same as <a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69" title="Helper macro, same as FLOW_UTIL_WHERE_AM_I(), but takes the source location details as arguments inst...">FLOW_UTIL_WHERE_AM_I_FROM_ARGS()</a> but with commas instead of <code>&lt;&lt;</code>. </dd></dl>

<p class="definition">Definition at line <a class="el" href="util_2detail_2util_8hpp_source.html#l00131">131</a> of file <a class="el" href="util_2detail_2util_8hpp_source.html">util.hpp</a>.</p>

</div>
</div>
<a id="a03c693936e039ffd16a3511050496a66" name="a03c693936e039ffd16a3511050496a66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03c693936e039ffd16a3511050496a66">&#9670;&nbsp;</a></span>FLOW_UTIL_WHERE_AM_I_LITERAL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FLOW_UTIL_WHERE_AM_I_LITERAL</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_function</td><td>)</td>
          <td>&#160;&#160;&#160;  <a class="el" href="util_2detail_2util_8hpp.html#a69c5777221db3730b1e235424c198506">FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_OUTER</a>(ARG_function, __LINE__)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Helper macro: like <a class="el" href="util__fwd_8hpp.html#a4b8c54b789ea3bbc1dedebbff084625c" title="Expands to an ostream fragment X (suitable for, for example: std::cout &lt;&lt; X &lt;&lt; &quot;: Hi!...">FLOW_UTIL_WHERE_AM_I()</a>, with a major relative strength &ndash; its replacement is a string literal &ndash; and two differences: the function name must be supplied verbatim as an arg; and the source file name will contain the entire path as opposed to a massaged version with just the file-name component. </p>
<p >The key is that the function name arg is not to be a string: it is <em>stringified</em> to get the string.</p>
<p >Nevertheless, in perf-sensitive scenarios, this may well be worth it. For now we keep it in a detail/ header for use internally to Flow; we did in fact need this in <a class="el" href="namespaceflow_1_1error.html" title="Flow module that facilitates working with error codes and exceptions; essentially comprised of niceti...">flow::error</a>.</p>
<p >Other than the aforementioned difference and mild formatting tweaks for cosmetics (as of this writing an added space), the format of the replacement's contents is identical to that from <a class="el" href="util__fwd_8hpp.html#a4b8c54b789ea3bbc1dedebbff084625c" title="Expands to an ostream fragment X (suitable for, for example: std::cout &lt;&lt; X &lt;&lt; &quot;: Hi!...">FLOW_UTIL_WHERE_AM_I()</a>.</p>
<h3>Rationale</h3>
<p >Why need <code>ARG_function</code>? Why not simply use <code>__FUNCTION__</code> internally? Answer: Despite its similar look to <code>__FILE__</code>, actually <code>__FUNCTION__</code> is <em>not</em> a macro: it is an identifier (that refers to a <code>const char*</code>). The preprocessor knows what file (and line) it's scanning; but it has no idea what func it's scanning; that's only known at a later stage of compilation. So long story short: <code>__FUNCTION__</code> is not replaced by a string literal and thus cannot be used to compose a string literal by compile-time concatenation.</p>
<p >(<code>constexpr</code> sweetness can be used for an otherwise compile-time-determined value; but we promised a literal here. <code>constexpr</code>ness is outside our scope. Though perhaps see <a class="el" href="util_2detail_2util_8hpp.html#aa0a4409a31022ddcb1a30936f59bbc69" title="Helper macro, same as FLOW_UTIL_WHERE_AM_I(), but takes the source location details as arguments inst...">FLOW_UTIL_WHERE_AM_I_FROM_ARGS()</a> for that.)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ARG_function</td><td>Informally this is something akin to <code>ARG_function</code> to <a class="el" href="error_2error_8hpp.html#a636b2d30a8785df6e84646b568bce9b5" title="Narrow-use macro that implements the error code/exception semantics expected of most public-facing Fl...">FLOW_ERROR_EXEC_AND_THROW_ON_ERROR()</a>. Formally this can be anything; it will be stringified via <code>#ARG_function</code> and output as the function name. (Do not attempt to pass here the name of a string-typed variable; that probably won't do what you want. E.g., if you invoke <code><a class="el" href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66" title="Helper macro: like FLOW_UTIL_WHERE_AM_I(), with a major relative strength – its replacement is a stri...">FLOW_UTIL_WHERE_AM_I_LITERAL(func_name)</a></code>, and <code>func_name</code> is an <code>std::string</code> with a function name, then the macro replacement will be <code>"/some/file.cpp:func_name(332)"</code> &ndash; without <code>func_name</code> getting replaced by the contents of your <code>func_name</code> variable or whatever.) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A string literal containing file name (and path; from <code>__FILE__</code>), function name given, and line number (from <code>__LINE__</code>). The string literal will be in the form <code>"stuff" "more stuff" "more stuff"</code> (etc.). There will be no surrounding parentheses (in case you want to compile-time-concatenate to even more literal segments). </dd></dl>

<p class="definition">Definition at line <a class="el" href="util_2detail_2util_8hpp_source.html#l00169">169</a> of file <a class="el" href="util_2detail_2util_8hpp_source.html">util.hpp</a>.</p>

</div>
</div>
<a id="a4ac08f92e1ffa27b2743e635f54aeddd" name="a4ac08f92e1ffa27b2743e635f54aeddd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ac08f92e1ffa27b2743e635f54aeddd">&#9670;&nbsp;</a></span>FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_INNER</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_INNER</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_function, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_line&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;  __FILE__ &quot;: &quot; #ARG_function &quot;(&quot; #ARG_line &quot;)&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Impl helper macro from <a class="el" href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66" title="Helper macro: like FLOW_UTIL_WHERE_AM_I(), with a major relative strength – its replacement is a stri...">FLOW_UTIL_WHERE_AM_I_LITERAL()</a>. </p>
<p >This is the real impl; see also <a class="el" href="util_2detail_2util_8hpp.html#a69c5777221db3730b1e235424c198506" title="Impl helper macro from FLOW_UTIL_WHERE_AM_I_LITERAL().">FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_OUTER()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ARG_function</td><td>See <a class="el" href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66" title="Helper macro: like FLOW_UTIL_WHERE_AM_I(), with a major relative strength – its replacement is a stri...">FLOW_UTIL_WHERE_AM_I_LITERAL()</a>. </td></tr>
    <tr><td class="paramname">ARG_line</td><td>The line number integer as from <code>__LINE__</code>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="util_2detail_2util_8hpp_source.html#l00194">194</a> of file <a class="el" href="util_2detail_2util_8hpp_source.html">util.hpp</a>.</p>

</div>
</div>
<a id="a69c5777221db3730b1e235424c198506" name="a69c5777221db3730b1e235424c198506"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a69c5777221db3730b1e235424c198506">&#9670;&nbsp;</a></span>FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_OUTER</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_OUTER</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_function, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ARG_line&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;  <a class="el" href="util_2detail_2util_8hpp.html#a4ac08f92e1ffa27b2743e635f54aeddd">FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_INNER</a>(ARG_function, ARG_line)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Impl helper macro from <a class="el" href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66" title="Helper macro: like FLOW_UTIL_WHERE_AM_I(), with a major relative strength – its replacement is a stri...">FLOW_UTIL_WHERE_AM_I_LITERAL()</a>. </p>
<p >This intermediate between that guy and the "true" impl macro <a class="el" href="util_2detail_2util_8hpp.html#a4ac08f92e1ffa27b2743e635f54aeddd" title="Impl helper macro from FLOW_UTIL_WHERE_AM_I_LITERAL().">FLOW_UTIL_WHERE_AM_I_LITERAL_IMPL_INNER()</a> is needed in order for the preprocessor to substitute <code>__LINE__</code> instead of simply stringifying it as <code>"__LINE__"</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ARG_function</td><td>See <a class="el" href="util_2detail_2util_8hpp.html#a03c693936e039ffd16a3511050496a66" title="Helper macro: like FLOW_UTIL_WHERE_AM_I(), with a major relative strength – its replacement is a stri...">FLOW_UTIL_WHERE_AM_I_LITERAL()</a>. </td></tr>
    <tr><td class="paramname">ARG_line</td><td>Literally <code>__LINE__</code>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="util_2detail_2util_8hpp_source.html#l00182">182</a> of file <a class="el" href="util_2detail_2util_8hpp_source.html">util.hpp</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 28 2025 22:55:35 for Flow by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
